﻿
/*----------------------------------------------------------------//
// 文件名：MoTrole.cs
// 文件功能描述：实体 MoTrole.
// 
// 创建标识：2009-02-27
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoTrole
using System;
using System.Data;
using System.Globalization;
using System.Text;
using System.Xml;
using System.Data.Common;
namespace EQT.Model
{
	/// <summary>
	/// 业务实体MoTrole
	/// </summary>
	public partial class MoTrole:ICloneable
	{
		#region 表Trole的字段
		private string _role_id;
		private string _role_name;
		private string _rem;
		#endregion
		
		#region 构造函数
		public MoTrole()
		{
		    
		    
		    
		}
		#endregion
		
		#region 拷贝构造函数

		public MoTrole(MoTrole item)
		{
			item.CopyTo(this);
		}
		#endregion
		
		#region 带参数构造函数
	    public MoTrole(string role_id,string role_name,string rem)
		{
		this._role_id=role_id;
		this._role_name=role_name;
		this._rem=rem;
		}
		#endregion
		
		#region 表Trole的字段属性
		/// <summary>
		/// ROLE_ID
		/// </summary>
		public string Role_Id
		{
			get {return _role_id;}
			set {_role_id=value;}
		}
		/// <summary>
		/// ROLE_NAME
		/// </summary>
		public string Role_Name
		{
			get {return _role_name;}
			set {_role_name=value;}
		}
		/// <summary>
		/// REM
		/// </summary>
		public string Rem
		{
			get {return _rem;}
			set {_rem=value;}
		}
		#endregion
		
		#region 辅助函数
		/// <summary>
		/// 拷贝函数
		/// </summary>
		public MoTrole CopyTo(MoTrole item)
        {
		    item.Role_Id=this.Role_Id;
		    item.Role_Name=this.Role_Name;
		    item.Rem=this.Rem;
			return item;
        }
		/// <summary>
		/// 克隆函数
		/// </summary>		
		public object Clone()
        {
            MoTrole NewTrole=new MoTrole();
		    NewTrole._role_id=this._role_id;
		    NewTrole._role_name=this._role_name;
		    NewTrole._rem=this._rem;
			return NewTrole;
		}
		
		private static MoTrole _empty = new MoTrole(string.Empty,string.Empty,string.Empty);
        public static MoTrole Empty
        {
            get
            {
                return _empty;
            }
        }
		
		///<summary>
		///判断对象是否相等
		///<summary>
		public override bool Equals(object obj)
        {
            if (base.Equals(obj))
            {
                return true;
            }
            else
            {
                MoTrole NewTrole = obj as MoTrole;
                if (NewTrole == null)
                {
                    return false;
                }
                else
                {
				if (NewTrole.Role_Id==this.Role_Id && NewTrole.Role_Name==this.Role_Name && NewTrole.Rem==this.Rem)		
					{
                        return true; 
                    }
                }

            }
            return false;
            
        }
		///TODO:you should modify GetHashCode by yourself.
		public override int GetHashCode()
		{
			return base.GetHashCode();
		} 

		public override string ToString()
        {
		   return String.Format("Role_Id={0}/Role_Name={1}/Rem={2}",_role_id,_role_name,_rem);
		 
		}
		#endregion
		
		#region DataTable Help Function
		///<summary>
		///DataRow转换成Model
		///</summary>
		public void Row2Model(DataRow row)
		{
		    if(row["Role_ID"]!=null && row["Role_ID"]!=DBNull.Value)
			{
			    this.Role_Id = (string)row["Role_ID"];
			}
			else
			{
				this.Role_Id =string.Empty;
			}
		    if(row["Role_Name"]!=null && row["Role_Name"]!=DBNull.Value)
			{
			    this.Role_Name = (string)row["Role_Name"];
			}
			else
			{
				this.Role_Name =string.Empty;
			}
		    if(row["Rem"]!=null && row["Rem"]!=DBNull.Value)
			{
			    this.Rem = (string)row["Rem"];
			}
			else
			{
				this.Rem =string.Empty;
			}
		}
		
		///<summary>
		///Model转换成DataRow
		///</summary>
	　　public void Model2Row(DataRow row)
		{
			row["Role_ID"] = this.Role_Id;
			row["Role_Name"] = this.Role_Name;
			row["Rem"] = this.Rem;
		}
		#endregion
	}
}
#endregion
